#include "demos.h"
#include "fontify.h"
+#include "demo_conf.h"
+
static GtkWidget *info_view;
static GtkWidget *source_view;
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can appear here: <http://www.gtk.org>");
- version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
+ version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
- "program-name", "GTK Demo",
+ "program-name", g_strcmp0 (PROFILE, "devel") == 0
+ ? "GTK Demo (Development)"
+ : "GTK Demo",
"version", version,
- "copyright", "© 1997—2020 The GTK Team",
+ "copyright", "© 1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK widgets",
window = (GtkWidget *)gtk_builder_get_object (builder, "window");
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (window));
+ if (g_strcmp0 (PROFILE, "devel") == 0)
+ gtk_widget_add_css_class (window, "devel");
+
action = g_simple_action_new ("run", NULL);
g_signal_connect (action, "activate", G_CALLBACK (activate_run), window);
g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (action));
endif
endforeach
+gtkdemo_deps += [ demo_conf_h ]
+
executable('gtk4-demo',
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
c_args: gtkdemo_args + demo_cflags,
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
+#include "demo_conf.h"
+
struct _IconBrowserApp
{
GtkApplication parent;
gtk_get_minor_version (),
gtk_get_micro_version ());
g_string_append_printf (s, "\nIcon theme\n\t%s", icon_theme);
- version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
+ version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
- "program-name", "GTK Icon Browser",
+ "program-name", g_strcmp0 (PROFILE, "devel") == 0
+ ? "GTK Icon Browser (Development)"
+ : "GTK Icon Browser",
"version", version,
- "copyright", "© 1997—2020 The GTK Team",
+ "copyright", "© 1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to browse themed icons",
IconBrowserWindow *win;
win = icon_browser_window_new (ICON_BROWSER_APP (app));
+
+ if (g_strcmp0 (PROFILE, "devel") == 0)
+ gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
+
gtk_window_present (GTK_WINDOW (win));
}
executable('gtk4-icon-browser',
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
- dependencies: libgtk_dep,
+ dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
+demo_conf = configuration_data()
+demo_conf.set_quoted('PROFILE', get_option('profile'))
+demo_conf.set_quoted('VCS_TAG', '@VCS_TAG@')
+
+demo_conf_h = declare_dependency(
+ sources: vcs_tag(
+ command: [ 'git', 'rev-parse', '--short', 'HEAD' ],
+ fallback: get_option('profile') != 'default' ? 'devel' : '',
+ input: configure_file(
+ output: 'demo_conf.h.in',
+ configuration: demo_conf
+ ),
+ output: 'demo_conf.h'
+ )
+)
+
subdir('constraint-editor')
subdir('gtk-demo')
subdir('icon-browser')
executable('gtk4-node-editor',
sources: [node_editor_sources, node_editor_resources],
- dependencies: libgtk_dep,
+ dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
#include "node-editor-window.h"
+#include "demo_conf.h"
+
static const char *css =
"textview.editor {"
" color: rgb(192, 197, 206);"
g_string_append_printf (s, "\nRenderer\n\t%s", renderer);
- version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
+ version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", gtk_application_get_active_window (app),
- "program-name", "GTK Node Editor",
+ "program-name", g_strcmp0 (PROFILE, "devel") == 0
+ ? "GTK Node Editor (Development)"
+ : "GTK Node Editor",
"version", version,
- "copyright", "© 2019—2020 The GTK Team",
+ "copyright", "© 2019—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to test GTK rendering",
NodeEditorWindow *win;
win = node_editor_window_new (NODE_EDITOR_APPLICATION (app));
+
+ if (g_strcmp0 (PROFILE, "devel") == 0)
+ gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
+
gtk_window_present (GTK_WINDOW (win));
}
executable('gtk4-print-editor',
sources: ['print-editor.c'],
c_args: common_cflags,
- dependencies: libgtk_dep,
+ dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include "demo_conf.h"
+
static GtkWidget *main_window;
static GFile *filename = NULL;
static GtkPageSetup *page_setup = NULL;
g_strfreev (backends);
g_free (setting);
- version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
+ version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", main_window,
- "program-name", "GTK Print Editor",
+ "program-name", g_strcmp0 (PROFILE, "devel") == 0
+ ? "GTK Print Editor (Development)"
+ : "GTK Print Editor",
"version", version,
- "copyright", "© 2006-2020 Red Hat, Inc",
+ "copyright", "© 2006-2021 Red Hat, Inc",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK printing",
GtkWidget *contents;
main_window = gtk_application_window_new (GTK_APPLICATION (app));
+
+ if (g_strcmp0 (PROFILE, "devel") == 0)
+ gtk_widget_add_css_class (GTK_WIDGET (main_window), "devel");
+
gtk_window_set_icon_name (GTK_WINDOW (main_window), "text-editor");
gtk_window_set_default_size (GTK_WINDOW (main_window), 400, 600);
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (main_window), TRUE);
executable('gtk4-widget-factory',
sources: ['widget-factory.c', widgetfactory_resources],
c_args: common_cflags,
- dependencies: libgtk_dep,
+ dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include "demo_conf.h"
+
static void
change_dark_state (GSimpleAction *action,
GVariant *state,
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can appear here: <http://www.gtk.org>");
- version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
+ version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", gtk_application_get_active_window (app),
"modal", TRUE,
- "program-name", "GTK Widget Factory",
+ "program-name", g_strcmp0 (PROFILE, "devel") == 0
+ ? "GTK Widget Factory (Development)"
+ : "GTK Widget Factory",
"version", version,
- "copyright", "© 1997—2020 The GTK Team",
+ "copyright", "© 1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK themes and widgets",
}
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
+
+ if (g_strcmp0 (PROFILE, "devel") == 0)
+ gtk_widget_add_css_class (GTK_WIDGET (window), "devel");
+
gtk_application_add_window (GTK_APPLICATION (app), window);
g_action_map_add_action_entries (G_ACTION_MAP (window),
win_entries, G_N_ELEMENTS (win_entries),
value: 'true',
description : 'Build demo programs')
+option('profile',
+ type: 'combo',
+ choices: [ 'default', 'devel' ],
+ value: 'default',
+ description : 'Profile to use for demos')
+
option('build-examples',
type: 'boolean',
value: 'true',